package ipebg.mzk.facade.system.service;


import ipebg.mzk.common.util.Page;
import ipebg.mzk.facade.entity.Org;
import ipebg.mzk.facade.entity.OrgLevel;
import ipebg.mzk.facade.system.bean.OrgBean;
import ipebg.mzk.facade.system.bean.OrgTreeBean;

import java.util.List;




public interface OrgService {

	/**
	 * 得到所有層級列表
	 * @return
	 */
	public List<OrgLevel> getOrgLevelList();
	
	
	public boolean saveOrUpdateOrg(Org entity);
	
	public Page getAllList(OrgBean org ,int from, int length) throws Exception ;
	public List<Org> getAllList();
	
	public List<OrgBean> toBean(List<Org> list);
	
	public Org findById(String id);
	
	public Org findByCode(String orgCode);
	
	public List findByCode(String levelNumber, String orgCode);
	
	public OrgLevel findOrgLevelById(String levelId);
	
	public boolean delOrg(String id); 
	
	public List<OrgTreeBean> getOrgTreeList(String parentId);
	
	public List<Org> getExcelReporterList(Org org);
	
	public List<Org> getOrgBeanList(Org org);

	/**
	 * 通過levelName查詢層級list
	 * @param levelName
	 * @return
	 */
	public List<OrgLevel> getOrgLevelList(String levelName);

	public List<Org> findOrgByLevelId(String levelId);
	
	/**
	 * 通過層級ID得到有效的組織
	 * @param levelId
	 * @return
	 */
	public List<Org> findEnableOrgByLevelNum(Integer levelNumber);
	
	/**
	 * 通過orgCode得到子節點列表
	 * @param orgCode
	 * @return
	 */
	public List<Org> findChildrenByParentId(String parentId,Integer levelNumber);


	public List<Org> findByDominate(String dominate,int level);
	public List<Org> findOrgByTwo(String orgLevelId,String dominate);

	/**
	 * 通過orgCode得到子節點列表（同廠區）
	 * @param orgCode
	 * @return
	 */
	public List<Org> findChildrenByParentId1(String parentId, String dominate,Integer levelNumber);


	public List<Org> findChildrenByParentId(String dominate, String orgId,
			Integer valueOf);


	public Org findOrg(String factoryName, String deptName);  
	
}
